package com.singzi.leetcode.jianzhiOffer;

public class T0024 {
}
class Solution0024 {
    public ListNode reverseList(ListNode head) {
        ListNode t;
        ListNode s = null;
        while (head!=null){
            t = head;
            head = head.next;
            t.next = s;
            s = t;
        }
        return s;
    }
}